<template>
    <fieldset>
        <legend>动态组件</legend>
        <h1 class="dynamic" :is="name">122</h1>
    </fieldset>
</template>
<script>
import comA from './comA.vue'
import comB from './comB.vue'
export default{
    components:{
        comA,
        comB
    },
    data(){
        return{
            name:'comA'
        }
    }
}
</script>
<style scoped>
.dynamic{
    border: 1px dashed hotpink;
}
</style>